home *** CD-ROM | disk | FTP | other *** search
/ PC go! 2008 April / PCgo 2008-04 (DVD).iso / interface / contents / demoversionen_3846 / 13664 / files / Data1.cab / rrecta.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-16  |  3.1 KB  |  108 lines

  1. /******************************************************************/
  2. /*                                                                */
  3. /*                      TurboCAD for Windows                      */
  4. /*                   Copyright (c) 1993 - 2001                    */
  5. /*             International Microcomputer Software, Inc.         */
  6. /*                            (IMSI)                              */
  7. /*                      All rights reserved.                      */
  8. /*                                                                */
  9. /******************************************************************/
  10.  
  11. // RRectA.cpp : Implementation of DLL Exports.
  12.  
  13.  
  14. // Note: Proxy/Stub Information
  15. //      To build a separate proxy/stub DLL, 
  16. //      run nmake -f RRectAps.mk in the project directory.
  17.  
  18. #include "stdafx.h"
  19. #include "resource.h"
  20. #include "RRectA.h"
  21.  
  22. #include "RRectA_i.c"
  23. #include "AutoRect.h"
  24.  
  25.  
  26. CComModule _Module;
  27.  
  28. BEGIN_OBJECT_MAP(ObjectMap)
  29. OBJECT_ENTRY(CLSID_AutoRect, CAutoRect)
  30. END_OBJECT_MAP()
  31.  
  32.  
  33. class CRRectAApp : public CWinApp
  34. {
  35. public:
  36.  
  37. // Overrides
  38.     // ClassWizard generated virtual function overrides
  39.     //{{AFX_VIRTUAL(CRRectAApp)
  40.     public:
  41.     virtual BOOL InitInstance();
  42.     virtual int ExitInstance();
  43.     //}}AFX_VIRTUAL
  44.  
  45.     //{{AFX_MSG(CRRectAApp)
  46.         // NOTE - the ClassWizard will add and remove member functions here.
  47.         //    DO NOT EDIT what you see in these blocks of generated code !
  48.     //}}AFX_MSG
  49.     DECLARE_MESSAGE_MAP()
  50. };
  51.  
  52. BEGIN_MESSAGE_MAP(CRRectAApp, CWinApp)
  53.     //{{AFX_MSG_MAP(CRRectAApp)
  54.         // NOTE - the ClassWizard will add and remove mapping macros here.
  55.         //    DO NOT EDIT what you see in these blocks of generated code!
  56.     //}}AFX_MSG_MAP
  57. END_MESSAGE_MAP()
  58.  
  59. CRRectAApp theApp;
  60.  
  61. BOOL CRRectAApp::InitInstance()
  62. {
  63.     _Module.Init(ObjectMap, m_hInstance, &LIBID_RRECTALib);
  64.     return CWinApp::InitInstance();
  65. }
  66.  
  67. int CRRectAApp::ExitInstance()
  68. {
  69.     _Module.Term();
  70.     return CWinApp::ExitInstance();
  71. }
  72.  
  73. /////////////////////////////////////////////////////////////////////////////
  74. // Used to determine whether the DLL can be unloaded by OLE
  75.  
  76. STDAPI DllCanUnloadNow(void)
  77. {
  78.     AFX_MANAGE_STATE(AfxGetStaticModuleState());
  79.     return (AfxDllCanUnloadNow()==S_OK && _Module.GetLockCount()==0) ? S_OK : S_FALSE;
  80. }
  81.  
  82. /////////////////////////////////////////////////////////////////////////////
  83. // Returns a class factory to create an object of the requested type
  84.  
  85. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  86. {
  87.     return _Module.GetClassObject(rclsid, riid, ppv);
  88. }
  89.  
  90. /////////////////////////////////////////////////////////////////////////////
  91. // DllRegisterServer - Adds entries to the system registry
  92.  
  93. STDAPI DllRegisterServer(void)
  94. {
  95.     // registers object, typelib and all interfaces in typelib
  96.     return _Module.RegisterServer(TRUE);
  97. }
  98.  
  99. /////////////////////////////////////////////////////////////////////////////
  100. // DllUnregisterServer - Removes entries from the system registry
  101.  
  102. STDAPI DllUnregisterServer(void)
  103. {
  104.     return _Module.UnregisterServer(TRUE);
  105. }
  106.  
  107.  
  108.